package com.functest.jpwise.deprecated.example;

import com.functest.jpwise.deprecated.AllPairsParameterFactory;
import com.functest.jpwise.deprecated.ParameterFactory;
import com.functest.jpwise.deprecated.example.fictionalwebsite.User;
import com.functest.jpwise.deprecated.example.fictionalwebsite.order.Coupon;
import com.functest.jpwise.deprecated.example.fictionalwebsite.order.Product;
import com.functest.jpwise.deprecated.example.fictionalwebsite.order.payment.Payment;

import org.junit.runners.Parameterized;
import java.util.List;

/** Represents a regression-test (all-pairs) version of ExampleTest.
 * Pairs each value of each parameter to each value of all other parameters.
 * Far from exhaustive, but hopefully will find most bugs. */
public class ExampleTest_Regression extends ExampleTest {
	public ExampleTest_Regression(User user, Product product, Coupon coupon, Payment payment) {
		super(user, product, coupon, payment);
	}

	/** Returns a relatively small list of parameter combinations (i.e. test cases).
	 * @return the combination list. */
	@Parameterized.Parameters public static List<Object[]> listOfParameterCombinations() {
		final ParameterFactory parameterFactory = new AllPairsParameterFactory();
		parameterFactory.setValuesToTestForEachParameter(
			valuesToTestForEachParameter() // use the values suggested by the abstract test
		);
		return parameterFactory.createListOfParameterCombinations();
	}
}
